<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QFontComboBox Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QFontComboBox Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QFontComboBox widget is a combobox that lets the user select
a font family. <a href="#details">More...</a></p>

<p>Inherits <a href="qcombobox.html">QComboBox</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qfontcombobox.html#FontFilter-enum">FontFilter</a></b> { AllFonts, ScalableFonts, NonScalableFonts, MonospacedFonts, ProportionalFonts }</li><li><div class="fn" />class <b><a href="qfontcombobox-fontfilters.html">FontFilters</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qfontcombobox.html#QFontComboBox">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />QFont <b><a href="qfontcombobox.html#currentFont">currentFont</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qfontcombobox.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>e</i>)</li><li><div class="fn" />FontFilters <b><a href="qfontcombobox.html#fontFilters">fontFilters</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qfontcombobox.html#setCurrentFont">setCurrentFont</a></b> (<i>self</i>, QFont&#160;<i>f</i>)</li><li><div class="fn" /><b><a href="qfontcombobox.html#setFontFilters">setFontFilters</a></b> (<i>self</i>, FontFilters&#160;<i>filters</i>)</li><li><div class="fn" /><b><a href="qfontcombobox.html#setWritingSystem">setWritingSystem</a></b> (<i>self</i>, QFontDatabase.WritingSystem)</li><li><div class="fn" />QSize <b><a href="qfontcombobox.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />QFontDatabase.WritingSystem <b><a href="qfontcombobox.html#writingSystem">writingSystem</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qfontcombobox.html#currentFontChanged">currentFontChanged</a></b> (const QFont&amp;)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QFontComboBox widget is a combobox that lets the user select
a font family.</p>
<p>The combobox is populated with an alphabetized list of font
family names, such as Arial, Helvetica, and Times New Roman. Family
names are displayed using the actual font when possible. For fonts
such as Symbol, where the name is not representable in the font
itself, a sample of the font is displayed next to the family
name.</p>
<p>QFontComboBox is often used in toolbars, in conjunction with a
<a href="qcombobox.html">QComboBox</a> for controlling the font
size and two <a href="qtoolbutton.html">QToolButton</a>s for bold
and italic.</p>
<p>When the user selects a new font, the <a href="qfontcombobox.html#currentFontChanged">currentFontChanged</a>()
signal is emitted in addition to <a href="qcombobox.html#currentIndexChanged">currentIndexChanged</a>().</p>
<p>Call <a href="qfontcombobox.html#writingSystem-prop">setWritingSystem</a>() to
tell QFontComboBox to show only fonts that support a given writing
system, and <a href="qfontcombobox.html#fontFilters-prop">setFontFilters</a>() to
filter out certain types of fonts as e.g. non scalable fonts or
monospaced fonts.</p>
<p class="centerAlign"><img alt="Screenshot of QFontComboBox on Windows XP" src="images/windowsxp-fontcombobox.png" /></p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="FontFilter-enum" />QFontComboBox.FontFilter</h3><p>This enum can be used to only show certain types of fonts in the
font combo box.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QFontComboBox.AllFonts</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Show all fonts</td>
</tr>
<tr>
<td class="topAlign"><tt>QFontComboBox.ScalableFonts</tt></td>
<td class="topAlign"><tt>0x1</tt></td>
<td class="topAlign">Show scalable fonts</td>
</tr>
<tr>
<td class="topAlign"><tt>QFontComboBox.NonScalableFonts</tt></td>
<td class="topAlign"><tt>0x2</tt></td>
<td class="topAlign">Show non scalable fonts</td>
</tr>
<tr>
<td class="topAlign"><tt>QFontComboBox.MonospacedFonts</tt></td>
<td class="topAlign"><tt>0x4</tt></td>
<td class="topAlign">Show monospaced fonts</td>
</tr>
<tr>
<td class="topAlign"><tt>QFontComboBox.ProportionalFonts</tt></td>
<td class="topAlign"><tt>0x8</tt></td>
<td class="topAlign">Show proportional fonts</td>
</tr>
</table>
<p>The FontFilters type is a typedef for <a href="qflags.html">QFlags</a>&lt;FontFilter&gt;. It stores an OR
combination of FontFilter values.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QFontComboBox" />QFontComboBox.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a font combobox with the given <i>parent</i>.</p>


<h3 class="fn"><a name="currentFont" /><a href="qfont.html">QFont</a> QFontComboBox.currentFont (<i>self</i>)</h3><h3 class="fn"><a name="event" />bool QFontComboBox.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>e</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>


<h3 class="fn"><a name="fontFilters" /><a href="qfontcombobox-fontfilters.html">FontFilters</a> QFontComboBox.fontFilters (<i>self</i>)</h3><h3 class="fn"><a name="setCurrentFont" />QFontComboBox.setCurrentFont (<i>self</i>, <a href="qfont.html">QFont</a>&#160;<i>f</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setCurrentFont(const QFont&amp;)</tt>.</p><h3 class="fn"><a name="setFontFilters" />QFontComboBox.setFontFilters (<i>self</i>, <a href="qfontcombobox-fontfilters.html">FontFilters</a>&#160;<i>filters</i>)</h3><h3 class="fn"><a name="setWritingSystem" />QFontComboBox.setWritingSystem (<i>self</i>, <a href="qfontdatabase.html#WritingSystem-enum">QFontDatabase.WritingSystem</a>)</h3><h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QFontComboBox.sizeHint (<i>self</i>)</h3><p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget.sizeHint</a>().</p>
<h3 class="fn"><a name="writingSystem" /><a href="qfontdatabase.html#WritingSystem-enum">QFontDatabase.WritingSystem</a> QFontComboBox.writingSystem (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="currentFontChanged" />void currentFontChanged (const QFont&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the current font changes, with
the new <i>font</i>.</p>
<p><b>See also</b> <a href="qfontcombobox.html#currentFont-prop">currentFont</a>.</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>